home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_26498.txt < prev    next >
Text File  |  1991-02-27  |  1KB  |  36 lines

  1. -- card: 26498 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10. TYPEDEF
  11.  
  12. Typedef declarations simply allow the programmer to define synonyms for commonly-used data types.  (Again, these synonyms must follow identifier naming rules*.  Some programmers capitalize the first or all letters in the synonym.)  For example, if the programmer wants to define variables which take on integer values but which are treated as boolean variables (only 0 or 1 allowed) in his/her own code, the following declaration may be used:
  13.  
  14.     typedef  int  boolean;      /*  just do this once, at top of file  */
  15.     boolean  success;               /*  success is actually an int variable  */
  16.  
  17. If pointers to personnel_rec structures are used frequently, the following may be used:
  18.  
  19.     typedef struct personnel_rec*  pr_ptr;    /*  just do this once, at top of file  */
  20.     pr_ptr  person;              /*  same as:  struct personnel_rec *person    */
  21.  
  22. -- part contents for background part 7
  23. ----- text -----
  24. 70
  25.  
  26. -- part contents for background part 29
  27. ----- text -----
  28. 22558
  29.  
  30. -- part contents for background part 27
  31. ----- text -----
  32. Identifier naming conventions
  33.  
  34. -- part contents for background part 20
  35. ----- text -----
  36. Identifier naming conventions - p51